<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 4.01 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page language="java" pageEncoding="UTF-8"%>
<%@ include file="/pages/safeai/jsp/common/taglibs.jsp"%>
<%@ include file="/pages/safeai/jsp/common/meta.jsp"%>
<html>
<head>
<title>商品管理</title>
<link href="${ctx}/css/safeai/together.css" rel="stylesheet" type="text/css">
<link href="${ctx}/css/jquery.popup.css" rel="stylesheet" type="text/css">
<link href="${ctx}/css/jquery.treeview.css" rel="stylesheet" type="text/css">
<script type='text/javascript' src='${ctx}/dwr/interface/productService.js'></script>
<script type='text/javascript' src='${ctx}/dwr/interface/filterService.js'></script>
<script type='text/javascript' src='${ctx}/dwr/engine.js'></script>
<script type="text/javascript" src="${ctx}/script/common/common.js"></script>
<script type="text/javascript" src="${ctx}/script/product/catalog.js"></script>
<script type="text/javascript" src="${ctx}/script/product/product.js"></script>
<script language="javascript" src="${ctx}/script/common/jquery.js"></script>
<script language="javascript" src="${ctx}/script/shop/productnotify.js"></script> 
<script language="javascript" src="${ctx}/script/common/jquery.treeview.js"></script>
<script language="javascript" src="${ctx}/script/common/jquery.cookie.js"></script>
<script language="javascript" src="${ctx}/script/common/jquery.dimensions.js"></script>
<script language="javascript" src="${ctx}/script/common/jquery.popup.js"></script>
<script type="text/javascript" src="${ctx}/dwr/interface/catalogHelper.js"></script>
<script type="text/javascript">
	function gotoPage1() { 
			var form = document.getElementsByTagName("form")[0];
			var youshi = form.elements["sdgqaerhw"].value;
			var zhengze = /^[0-9]*$/;
		    	if(zhengze.exec(youshi)){
					var wefw = form.elements["sdgqaerhw"].value;
					if(wefw==""||wefw<=0){
						form.elements["ye"].value = "1";
						form.elements["pager.offset"].value = "0";
						form.elements["pageSize"].value = 20;
					}else if(wefw>${pall}){
						form.elements["ye"].value = "${pall}";
						form.elements["pager.offset"].value = ((parseInt(${pall})-1)*20)+"";
						form.elements["pageSize"].value = 20;
					}else{
						form.elements["ye"].value = wefw;
						form.elements["pager.offset"].value = ((parseInt(form.elements["sdgqaerhw"].value)-1)*20)+"";
						form.elements["pageSize"].value = 20;
					}
					form.submit();
				}else{
					alert("格式错误");
					return false;
				}
			}
     $(document).ready(function(){
			jQuery(function($){
				    $("input#catalog").popup(builderTreeTag(1));
				    $(".treeview-popup").treeview({ 
			        persist: "cookie",
			        cookieId: "treeview-popup"
		        });
			    });
	$("ul.treeview-popup li>a").click(function(){
			document.getElementById("product.catalogId").value=this.id;
  	});
  })
 </script>
</head>
<body>
<bean:define id="priceName" name="USERINFO" property="username"/>
<input type="hidden" id="priceName" value="${priceName}"/>
<form name="productForm" action="${ctx}/product/productMessage.do?method=ProductList" method="post">
<table width="100%" style="padding:0px 0px 7px 7px">
    	<tr>
       	  <td class="td_3">商品名称模糊查询：</td>
          	<td class="td_04"><input type="text" name="product.name" maxlength="155" value="${sessionScope.History.name}"/></td>
            <td class="td_3">按照编码检索商品：</td>
            <td class="td_04"><input type="text" name="product.code" maxlength="20" value="${sessionScope.History.code}"/></td>
        </tr>
        <tr>
        	<td class="td_3">按照商品分类：</td>
            <td class="td_04"><input id="catalog" name="product.catalogName" type="text" value="${sessionScope.History.catalogName}" /></td>
            <input type="hidden" name="product.catalogId" value="${sessionScope.History.catalogId}" />
            <td class="td_3">按品牌查询：</td>
            <td class="td_04"><input type="text" name="pinpaicha" value="${xdbgaljgrbla}"/></td>
        </tr>
        <tr>
        	<td class="td_3">主商品ID查询：</td>
            <td colspan="3" class="td_04"><input type="text" name="product.main1" value="${product.main1}" readonly />
            &nbsp;&nbsp;
		<input type="button" class="btn" name="selector" value="选择" onclick="javascript:productSelector('','product.main1')" />&nbsp;
		<input type="button" class="btn" name="clear" value="清空" onclick="javascript:clean('product.main1');" />
            </td>
        </tr>
        <tr>
        	<td colspan="4" align="center"><input type="submit" class="btn" value="搜索"/>&nbsp;&nbsp;&nbsp;默认状态不包含停产和已删除</td>
        </tr>
    </table>
	<div >&nbsp;
	  &nbsp;&nbsp;
		&nbsp;
		
		
		&nbsp;&nbsp;
		
		&nbsp;&nbsp;
  </div>
	 <table width="100%" align="center">
		    <tr>
		    	<th class="td_01" height="25px">类别</th>
		    	<th class="td_01" >品牌</th>
				<th class="td_01">名称</th>
				<th class="td_01">编码</th>
				<th class="td_01">售价 </th>
                <th class="td_01">含税价</th>
				<th class="td_01" nowrap>积分</th>
		    	<th class="td_01">
		    		<select name="product.status" onchange="findStatus(this);">
		    			<logic:present name="History" property="status">
							<option value="-1" <logic:equal name="History" property="status" value="-1" >selected</logic:equal>>默认</option>
							<option value="0" <logic:equal name="History" property="status" value="0" >selected</logic:equal>>即将上市</option>
							<option value="1"  <logic:equal name="History" property="status" value="1" >selected</logic:equal>>现货</option>
							<option value="2"  <logic:equal name="History" property="status" value="2" >selected</logic:equal>>需订货</option>
							<option value="3"  <logic:equal name="History" property="status" value="3" >selected</logic:equal>>暂时缺货</option>
							<option value="4"  <logic:equal name="History" property="status" value="4" >selected</logic:equal>>停产</option>
							<option value="5"  <logic:equal name="History" property="status" value="5" >selected</logic:equal>>已删除</option>
						</logic:present>
						<logic:notPresent name="History" property="status">
							<option value="-1">默认</option>
							<option value="0" >即将上市</option>
							<option value="1" >现货</option>
							<option value="2" >需订货</option>
							<option value="3" >暂时缺货</option>
							<option value="4" >停产</option>
							<option value="5" >已删除</option>
						</logic:notPresent>
					</select>
				</th>
				<th class="td_01" nowrap>顺序</th>
		    	<th colspan="8" class="td_01">操作</th>
		    </tr>
		   <logic:present name="productList">
		   	<logic:iterate id="product" name="productList" property="records">
		    <tr id="${product.id }" >
		    	<td class="td_03">${product.catalogName}</td>
		    	<td class="td_03" nowrap>${product.brandName}</td>
				<td class="td_03">
					<a href="${ctx}/product/productMessage.do?method=shopDeatails&id=${product.id}" target="_blank">${product.name}</a>
				</td>
				<td class="td_03">${product.code}</td>
				<td class="td_03">${product.price}</td>
                <td class="td_03">${product.taxprice}</td>
				<td class="td_03" nowrap>${product.getPoint}</td>
		    	<td class="td_03">
			    	<bean:message key="status.${product.status}"/>
				</td>
				<td class="td_03">${product.sequence}</td>
		    	<td class="td_03"><a href="javaScript:void(0);" name="sequence" onClick="modifyCP(${product.id},'updateSequence',this);">修改顺序</a></td>
		    	<td class="td_03"><a href="${ctx}/product/productMessage.do?method=ToUpdateProduct&id=${product.id}&po=${po}&ps=${ps}">编辑资料</a></td>
		    	<td class="td_03"><a href="${ctx}/product/productMessage.do?method=CopyProduct&id=${product.id}">复制</a></td>
		    	<td class="td_03"><a href="javaScript:void(0);" name="price" onClick="modifyCP(${product.id},'updatePrice',this);">修改价格</a></td>
		    	<td class="td_03"><a href="#" onClick="deleteProduct(${product.id})">删除</a></td>
		    	<td class="td_03"><a href="javaScript:void(0);" onClick="toShowProductnotify('${product.id}','${product.name}')">到货通知名单</a></td>
		    	<td class="td_03"><a href="${ctx}/article/articleManage.do?method=articleList&article.pid=${product.id}&article.type=1">资讯</a></td>
		    	<td class="td_03">
		    	<select name="status" onchange="updateProduct(${product.id},this,'updateStatus');">
					<option value="0" <logic:equal name="product" property="status" value="0">selected</logic:equal>>即将上市</option>
					<option value="1" <logic:equal name="product" property="status" value="1">selected</logic:equal>>现货</option>
					<option value="2" <logic:equal name="product" property="status" value="2">selected</logic:equal>>需订货</option>
					<option value="3" <logic:equal name="product" property="status" value="3">selected</logic:equal>>暂时缺货</option>
					<option value="4" <logic:equal name="product" property="status" value="4">selected</logic:equal>>停产</option>
					<option value="5"  <logic:equal name="product" property="status" value="5" >selected</logic:equal>>已删除</option>
		    	</select>
	    		</td>
		    </tr>
		   	</logic:iterate>
		   </logic:present>
		    <tr>
				<td colspan="18" align="right">
				<div style="float:left">&nbsp;&nbsp;<a href="${ctx}/product/productMessage.do?method=ToAddProduct">添加产品</a></div>
                <%@ include file="/pages/safeai/jsp/common/page1.jsp"%>&nbsp;&nbsp;&nbsp;&nbsp;
			</td>
		</tr>
		
</table>
<input type="hidden" name="method" value="ProductList">
</form>
</body>
</html>
